import time

from selenium import webdriver
from selenium.webdriver.edge.service import Service

if __name__ == '__main__':
    url1 = "https://www.baidu.com"
    url2 = "https://www.jd.com"
    url3 = "https://www.taobao.com"

    executable_path = "../driver/msedgedriver.exe"
    service = Service(executable_path=executable_path)
    browser = webdriver.Edge(service=service)

    browser.get(url=url1)
    baidu = browser.current_window_handle
    time.sleep(10)

    jingdong = browser.execute_script("window.open('https://www.jd.com')")
    time.sleep(10)

    taobao = browser.execute_script("window.open('https://www.taobao.com')")
    time.sleep(10)

    # 切换到 百度 页面
    browser.switch_to.window(baidu)
    time.sleep(15)

    browser.quit()
